package cn.quevo.cube.provide.define.validate.impl;


import cn.quevo.cube.provide.define.enums.FileTypes;
import cn.quevo.cube.provide.define.validate.ColumnTypeValidate;
import cn.quevo.cube.provide.define.validate.FileTypeValidate;
import cn.quevo.cube.provide.exception.ColumnCheckException;
import cn.quevo.cube.provide.exception.response.ColumnExceptionResponse;

/**
 * 文件上传类型验证
 *
 * @author July july_sky@foxmail.com
 * @version 1.0
 * @date 2018/12/14 5:40 PM
 * @Copyright 湘豫（北京）科技有限公司版权所有.All Rights Reserved.
 */
public class FileUploadValidate extends UploadValidate implements ColumnTypeValidate {
    @Override
    protected void checkExt(String fileTypes) {
        if (!FileTypeValidate.vaidateAll(FileTypes.FILE.getValue(), fileTypes)) {
            throw new ColumnCheckException(ColumnExceptionResponse.FILE_TYPE_FAILD);
        }
    }
}
